package com.neusoft.Controller;

import com.neusoft.po.Course;
import com.neusoft.po.ResponseBean;
import com.neusoft.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/course")
@RefreshScope   // 开启动态刷新
public class CourseController {

    @Autowired
    private CourseService cs;


    @GetMapping("/getCourse/{cno}")
    public ResponseBean<Course> getCourse(@PathVariable String cno){
        return cs.getCourseByNo(cno);
    }
}
